package housing.task3.dto.PK;

import java.io.Serializable;

/**
 * This class represents the primary key of the HS_Address table.
 */
public class HsAddressPk implements Serializable {
    protected int addressId;

    /**
     * This attribute represents whether the primitive attribute addressId is null.
     */
    protected boolean addressIdNull;

    /**
     * Sets the value of addressId
     */
    public void setAddressId(int addressId) {
        this.addressId = addressId;
    }

    /**
     * Gets the value of addressId
     */
    public int getAddressId() {
        return addressId;
    }

    /**
     * Method 'HsAddressPk'
     */
    public HsAddressPk() {
    }

    /**
     * Method 'HsAddressPk'
     *
     * @param addressId
     */
    public HsAddressPk(final int addressId) {
        this.addressId = addressId;
    }

    /**
     * Sets the value of addressIdNull
     */
    public void setAddressIdNull(boolean addressIdNull) {
        this.addressIdNull = addressIdNull;
    }

    /**
     * Gets the value of addressIdNull
     */
    public boolean isAddressIdNull() {
        return addressIdNull;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof HsAddressPk)) {
            return false;
        }

        final HsAddressPk _cast = (HsAddressPk) _other;
        if (addressId != _cast.addressId) {
            return false;
        }

        if (addressIdNull != _cast.addressIdNull) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + addressId;
        _hashCode = 29 * _hashCode + (addressIdNull ? 1 : 0);
        return _hashCode;
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    public String toString() {
        StringBuffer ret = new StringBuffer();
        ret.append("HsAddressPk: ");
        ret.append("addressId=" + addressId);
        return ret.toString();
    }

}
